package com.transcasafe.eanpay.example.pay;

import com.alibaba.fastjson.JSONObject;
import com.transcasafe.eanpay.core.config.EanPayConfig;
import com.transcasafe.eanpay.core.service.EanPayCardService;
import com.transcasafe.eanpay.core.service.model.UpdateLogisticsInfoRequest;
import com.transcasafe.eanpay.core.service.model.UpdateLogisticsInfoResponse;
import com.transcasafe.eanpay.example.MchConfig;

/**
 * 上报物流运单信息
 */
public class EanPayUpdateLogisticsInfoServiceExample {
    public static void main(String[] args) {
        EanPayConfig config = new EanPayConfig.Builder().mchNo(MchConfig.mchNo).mchKey(MchConfig.mchKey).build();
        EanPayCardService service = new EanPayCardService.Builder().config(config).hostname(MchConfig.hostname).build();
        UpdateLogisticsInfoRequest request = new UpdateLogisticsInfoRequest();

        request.setOrderNo("CP202502210915251563RTZZL");
        request.setLogisticsCompany("DHL");
        request.setLogisticsOrderNo("879689622212121212121");
        UpdateLogisticsInfoResponse response = service.updateLogisticsInfo(request);
        System.out.println(JSONObject.toJSONString(response));
    }
}
